home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6196 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Passing structures--related Q
  5. Date: 22 Feb 1996 23:31:09 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb22163109@qcd.lanl.gov>
  8. References: <17735D030S86.JJSTEP00@ukcc.uky.edu>
  9. NNTP-Posting-Host: qcd.lanl.gov
  10. Mime-Version: 1.0
  11. Content-Type: text
  12. In-reply-to: JJSTEP00@ukcc.uky.edu's message of Thu, 22 Feb 96 14:48:16 EST
  13.  
  14. Path: newshost.lanl.gov!ncar!gatech!ukma!ukcc.uky.edu!JJSTEP00
  15. From: JJSTEP00@ukcc.uky.edu (Jason Stephenson)
  16. Newsgroups: comp.lang.c
  17. Subject: Passing structures--related Q
  18. Date: Thu, 22 Feb 96 14:48:16 EST
  19. Organization: The University of Kentucky
  20. Lines: 17
  21. Message-ID: <17735D030S86.JJSTEP00@ukcc.uky.edu>
  22. NNTP-Posting-Host: ukcc.uky.edu
  23.  
  24. In article <17735D030S86.JJSTEP00@ukcc.uky.edu>
  25. JJSTEP00@ukcc.uky.edu (Jason Stephenson) writes:
  26. <snip>
  27. JJS: /* code */
  28. JJS: some_func({x, y});
  29. JJS: /* more code */
  30. JJS:  
  31. JJS: What I'm trying to figure out is, can you replace a struct with
  32. its values? 
  33.  
  34. No. In C, no instances of unnamed composite types exist. (Actually,
  35. there are two exceptions depending on your point of view: first, if x
  36. is a pointer to a composite type, *x is naturally of type x. Second,
  37. string literals are arrays.)
  38.  
  39. The syntax {...} is valid in an initializer for a named object of
  40. composite type.
  41.  
  42. Cheers
  43. Tanmoy
  44. --
  45. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  46. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  47. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  48. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  49. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  50. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  51.